/*************************************************************************
	> File Name: P1011.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-01-06 11:31:03
 ************************************************************************/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define N 1001
using namespace std;
int a,n,m,x,t,f[N];
int main(){
    scanf("%d%d%d%d",&a,&n,&m,&x);
    f[1]=1;f[2]=1;
    for(int i=3;i<=n;i++)
     f[i]=f[i-1]+f[i-2];
    t=(m-(f[n-3]+1)*a)/(f[n-2]-1);
    printf("%d",(f[x-2]+1)*a+(f[x-1]-1)*t);
    return 0;
}
